-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
grafana_folder: add permissions #231
base: main
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## main #231 +/- ##
==========================================
+ Coverage 68.76% 69.37% +0.61%
==========================================
Files 16 16
Lines 1700 1760 +60
Branches 287 304 +17
==========================================
+ Hits 1169 1221 +52
- Misses 398 401 +3
- Partials 133 138 +5
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
self._module.fail_json(failed=True, msg="User '%s' does not exists" % email) | ||
return user.get("id") | ||
|
||
def get_team(self, name): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already have code in grafana_team.py
doing this (line 241).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we export these functions to module_utils and import this from both modules? Could be also interesting for other functions like
def get_version(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, that is something I'd like to do at some point ; have all Grafana API call related stuff in module_utils and have our library that we can use in all modules.
I guess it will be easier if you move the team related stuff that you need to have the big change that I will never have time to review properly.
Sorry for the delay on this PR.
- assert: | ||
that: | ||
- "result.changed == false" | ||
- "result.failed == true" | ||
- "result.msg == expected_error" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@CWollinger I don't know if you still want to finish this PR but I am realizing now after coming back to this PR that we don't check the permissions in these tests.
I believe that the permissions should be in the module outputs and an assert performed to check it is the proper ones.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I will check this.
SUMMARY
Able to set permissions of a folder
ISSUE TYPE
COMPONENT NAME
grafana_folder
ADDITIONAL INFORMATION
fix #213